import React from 'react';
import GUtils from "@/utils";
import {Link} from "react-router-dom";

const Config = (Action) => {
    const Handlers = {

    }
    const columns = [
       
        {title:"广告位",dataIndex:"position",width:60,render:v=>GUtils.dealEnumValue(v, "AdsPosition")},
        {title:"标题",dataIndex:"title",width:120,render:(v,vo)=><Link to={`detail/view?id=${vo.uid}`}>{v}</Link>},
        {title:"最后更新",dataIndex:"updateTime",width:60,render:v=>GUtils.dateTimeFormatter(v)},
        {title:"状态",dataIndex:"enabled",width:40,render:v=>v?"展示":"不展示"},
        {title:"排序",dataIndex:"order",width:40},

        {title: '操作',dataIndex: 'id',width: 60,render(id,vo){
                return <div>
                    {GUtils.renderEditLink(id,"mr-8")}
                    {GUtils.renderEnabledLink(vo, "广告" ,"title", Action)}
                </div>
            }},
    ];
    return {
        ...window.CONFIG.getPagerConfig(Action), columns
    };
};


export default Config;
